package com.kedacom.ctsp.authority.entity;


import com.kedacom.ctsp.web.entity.AbstractTreeSortSupportEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Set;

/**
 * 部门
 *
 * @author
 */
@Data
@Entity
@Table(name = "department")
public class SimpleDepartmentForTree extends AbstractTreeSortSupportEntity<DepartmentForTree, String> implements DepartmentForTree {

    /**
     * 主键id ，自增长
     */
    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @ApiModelProperty("主键id")
    private String id;
    /**
     * 所在地区(字典)
     */
    private String district;
    /**
     * 名称
     */
    private String name;
    /**
     * 全称
     */
    private String fullName;
    /**
     * 部门编码
     */
    private String code;
    /**
     * 描述
     */
    private String description;

    private String parent_id;

    @Transient
    private DepartmentForTree parent;

    /**
     * 角色
     */
    @Transient
    private Set<Role> roles;
    /**
     * 扩展字段
     */
    @Column(length = 4000)
    private String extendedField;
    /**
     * 单位级别
     */
    private String grade;
    /**
     * 单位类型
     */
    private String type;

    public String toString(){
        return "";
    }
}